﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HR60_PanelSoft.Model;

namespace HR60_PanelSoft.Service
{
    //GC: [g0]提供业务层的约束

    /* [g0.s2] */
    /* 
     * 此枚举必须与函数GetMaxofModels同步修改 
     */
    /// <summary>
    /// 
    /// </summary>
    public enum RestrictionMax
    {
        MaxNetsInProj,
        MaxAirCtrlsInProj,
        MaxHeatsInProj,
        MaxNewWindsInProj,
        MaxBGMsInProj,
        MaxPanelsInNet,
    }

    /* end of [g0.s1] */

    /* [g0.s1] */
    /// <summary>
    /// 提供业务层的约束
    /// </summary>
    public static class RestrictionService
    {
        /*
         * 此函数必须与枚举RestrictionMax 同步修改        
         */
        /// <summary>
        /// 获取最大值限制的值
        /// </summary>
        /// <param name="name">限制名</param>
        /// <returns>最大值</returns>
        public static int GetMaxofModels(RestrictionMax name)
        {
            int rst = -1;
            switch (name)
            {
                case RestrictionMax.MaxAirCtrlsInProj:
                    rst = 1;
                    break;
                case RestrictionMax.MaxBGMsInProj:
                    rst = 1;
                    break;
                case RestrictionMax.MaxHeatsInProj:
                    rst = 1;
                    break;
                case RestrictionMax.MaxNewWindsInProj:
                    rst = 1;
                    break;
                case RestrictionMax.MaxNetsInProj:
                    rst = 8;
                    break;
                case RestrictionMax.MaxPanelsInNet:
                    rst = 32;
                    break;
                default:
                    break;
            }
            return rst;
        }


        public static bool IsCanNew(RestrictionMax name)
        {
            bool rst = false;



            return rst;
        }

        private static int getModelsNum(DeviceType type)
        {
            int rst = -1;

            return rst;
        }

        
    }
}
